package com.zhaoran.dcruitmentzhaoran.web;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.wangyongliang.common.vo.ResultEntity;
import com.wangyongliang.common.vo.ZhaoranFanhui;
import com.zhaoran.dcruitmentzhaoran.entity.Company;
import com.zhaoran.dcruitmentzhaoran.service.ICompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author （- · -）赵冉专属代码
 * @since 2020-03-23
 */
@RestController
@RequestMapping("/company")
public class CompanyController {

    @Autowired
    private ICompanyService service;

    @RequestMapping("list")
    public ResultEntity list(@RequestBody Integer gid){
        List<ZhaoranFanhui> list = service.list(gid);

        return ResultEntity.ok(list);
    }

    @RequestMapping("gong")
    public ResultEntity gong(){

        EntityWrapper<Company> companyEntityWrapper = new EntityWrapper<>();
        List<Company> companies = service.selectList(companyEntityWrapper);
        return ResultEntity.ok(companies);
    }
}
